<?php
/* @var $this StatusController */
/* @var $model Status */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'status-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo Yii::t('base','Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>


	<div class="row">
		<?php //echo $form->labelEx($model,'customer_id'); ?>
		<?php //echo $form->textField($model,'customer_id'); ?>
		<?php //echo $form->error($model,'customer_id'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'campaign_id'); ?>
		<?php //echo $form->textField($model,'campaign_id'); ?>
		<?php echo $form->dropDownList($model, 'campaign_id',CHtml::listData( Campaign::model()->findAll(), 'zy_campaign_id', 'campaign_name')  );?>
		<?php echo $form->error($model,'campaign_id'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'agent_id'); ?>
		<?php //echo $form->textField($model,'agent_id'); ?>
		<?php echo $form->dropDownList($model, 'agent_id',CHtml::listData( User::model()->findAll('level=:level',array(':level'=>'12')), 'user_id', 'user_name')  );?>
		<?php echo $form->error($model,'agent_id'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php //echo $form->textField($model,'status',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->dropDownList($model, 'status',array('1'=>'No Answer','2'=>'Busy or Not Available','3'=>'Invalid Number','4'=>'Do not call again','5'=>'No interest','6'=>'Qualified lead','7'=>'Won',) );?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'callback_date_and_time'); ?>
		<?php //echo $form->textField($model,'callback_date_and_time',array('size'=>60,'maxlength'=>255)); ?>
  <input type="text" id="callback_date_and_time" name="Status[callback_date_and_time]" size="20" value="<?php echo $model->callback_date_and_time=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->callback_date_and_time;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" /></p>
		<?php echo $form->error($model,'callback_date_and_time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'last_called_date_and_time'); ?>
		<?php //echo $form->textField($model,'last_called_date_and_time',array('size'=>60,'maxlength'=>255)); ?>
		  <input type="text" id="last_called_date_and_time" name="Status[last_called_date_and_time]" size="20" value="<?php echo $model->last_called_date_and_time=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->last_called_date_and_time;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" /></p>
		<?php echo $form->error($model,'last_called_date_and_time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'notes'); ?>
		<?php echo $form->textArea($model,'notes',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'notes'); ?>
	</div>

	<div class="row">
		 <p><span><?php echo Yii::t('base','follow up' );?>: </span><br/>
        <input type="text" id="follow_up1" name="Status[follow_up]" size="20" value="<?php echo $model->follow_up=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->follow_up;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" /></p>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'sign_up_date'); ?>
		<?php //echo $form->textField($model,'sign_up_date',array('size'=>60,'maxlength'=>255)); ?>
		<?php //echo $form->error($model,'sign_up_date'); ?>
	 <p><span><?php echo Yii::t('base','sign up date');?> : </span><br/>
        <input type="text" id="sign_up_date1" name="Status[sign_up_date]" size="20"  value="<?php echo $model->sign_up_date=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->sign_up_date;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" />
      </p>
	</div>

	<div class="row">
		<?php //echo $form->labelEx($model,'contract_expire_date'); ?>
		<?php //echo $form->textField($model,'contract_expire_date',array('size'=>60,'maxlength'=>255)); ?>
		<?php //echo $form->error($model,'contract_expire_date'); ?>
	   <p><span><?php echo Yii::t('base','Contract Expire date');?> : </span><br/>
        <input type="text" id="contract_expire_date1" name="Status[contract_expire_date]" size="24" value="<?php echo $model->contract_expire_date=='0000-00-00 00:00:00'?date("Y-m-d H:i:s",strtotime("+7 days")):$model->contract_expire_date;?>" onClick="WdatePicker({startDate:'%y-%M-01 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true})" " style="width:245px;" />
      </p>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'package'); ?>
		<?php echo $form->textField($model,'package',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'package'); ?>
	</div>

	<div class="row">
		<p><span><?php echo Yii::t('base','CustomerAddress' );?>: </span><br/>
		 <input type="text" id="address" name="PotentialCustomers[address]" size="20" value="<?php echo $modelPotentialCustomers->address;?>"/>
      </p>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('base','Create') : Yii::t('base','Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->